﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Linq;
using System.Xml;
using AutoMapper;

namespace SPContrib.TypeConverters
{
    public class XElementToXmlDocument : TypeConverter<XElement, XmlDocument>
    {
        protected override XmlDocument ConvertCore(XElement source)
        {
            using (XmlReader xr = source.CreateReader())
            {
                XmlDocument xml = new XmlDocument();

                xml.Load(xr);
                return xml;
            }
        }
    }
}
